package com.hjy.product.vo.item;

import com.hjy.product.entity.SkuImagesEntity;
import com.hjy.product.entity.SkuInfoEntity;
import com.hjy.product.entity.SpuInfoDescEntity;
import lombok.Data;
import org.springframework.cache.annotation.CacheEvict;

import java.util.List;

@Data
public class SkuItemVo {
    // 1, 获取 sku 基本信息 pms_sku_info
    private SkuInfoEntity skuInfo;
    // 2, 获取 sku 图片信息 pms_sku_images
    private List<SkuImagesEntity> skuImages;
    // 3, 获取 spu 销售属性的集合
    private List<SpuItemSaleAttr> spuItemSaleAttrs;
    // 4, 获取 spu 介绍
    private SpuInfoDescEntity spuInfoDesc;
    // 5, 获取对应 spu 规格属性的集合组
    private List<SpuItemBaseAttrGroup> spuItemBaseAttrGroups;

    @Data
    public static class SpuItemSaleAttr {
        private Long attrId;
        private String attrName;
        private List<AttrValueWithIds> attrValueWithIds;
    }

    @Data
    public static class AttrValueWithIds {
        private String attrValue;
        private String skuIds;
    }

    @Data
    public static class SpuItemBaseAttrGroup {
        private String groupName;
        private List<SpuBaseAttr> spuBaseAttrs;
    }

    @Data
    public static class SpuBaseAttr {
        private String attrName;
        private String attrValue;
    }

}
